package com.example.demo.util;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class FaceRegUtil {
    public static String detectOne(String pythonV, String Img, String py, String banjiLg) throws IOException, InterruptedException {
        String temp = "";
        String[] args1 = new String[]{pythonV, py, Img, banjiLg};
        Process pr = null;
        BufferedReader in = null;
        try {
            pr = Runtime.getRuntime().exec(args1);
            in = new BufferedReader(new InputStreamReader(
                    pr.getInputStream()));
            temp = in.readLine();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (in != null) {
                in.close();
            }
            if (pr != null) {
                pr.waitFor();
            }
            return temp;
        }
    }
}
